package com.hmall.search.pojo;


import com.hmall.common.dto.Item;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

@Data

public class SearchItem {
    private Long id;//商品id
    private String name;//商品名称
    private Long price;//价格（分）
    private String image;//商品图片
    private String category;//分类名称
    private String brand;//品牌名称
    private Integer sold;//销量
    private Integer commentCount;
    private Boolean isAD;
    private List<String> suggestion=new ArrayList<>(2);

    public SearchItem(Item item){
        BeanUtils.copyProperties(item,this);
        suggestion.add(item.getBrand());
        suggestion.add(item.getCategory());
    }

}
